/*!artDialog*/
(function(window, undefined) {
    var $ = window.art = function(selector, context) {
        return new $.fn.constructor(selector, context)
    },
    quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
    rclass = /[\n\t]/g;
    if (window.$ === undefined) {
        window.$ = $
    }
    $.fn = $.prototype = {
        constructor: function(selector, context) {
            var match, elem;
            context = context || document;
            if (!selector) {
                return this
            }
            if (selector.nodeType) {
                this[0] = selector;
                return this
            }
            if (typeof selector === "string") {
                match = quickExpr.exec(selector);
                if (match && match[2]) {
                    elem = context.getElementById(match[2]);
                    if (elem && elem.parentNode) {
                        this[0] = elem
                    }
                    return this
                }
            }
            this[0] = selector;
            return this
        },
        hasClass: function(name) {
            var className = " " + name + " ";
            if ((" " + this[0].className + " ").replace(rclass, " ").indexOf(className) > -1) {
                return true
            }
            return false
        },
        addClass: function(name) {
            if (!this.hasClass(name)) {
                this[0].className += " " + name
            }
            return this
        },
        removeClass: function(name) {
            var elem = this[0];
            if (!name) {
                elem.className = ""
            } else {
                if (this.hasClass(name)) {
                    elem.className = elem.className.replace(name, " ")
                }
            }
            return this
        },
        css: function(name, value) {
            var i, elem = this[0],
            obj = arguments[0];
            if (typeof name === "string") {
                if (value === undefined) {
                    return $.css(elem, name)
                } else {
                    elem.style[name] = value
                }
            } else {
                for (i in obj) {
                    elem.style[i] = obj[i]
                }
            }
            return this
        },
        show: function() {
            return this.css("display", "block")
        },
        hide: function() {
            return this.css("display", "none")
        },
        offset: function() {
            var elem = this[0],
            box = elem.getBoundingClientRect(),
            doc = elem.ownerDocument,
            body = doc.body,
            docElem = doc.documentElement,
            clientTop = docElem.clientTop || body.clientTop || 0,
            clientLeft = docElem.clientLeft || body.clientLeft || 0,
            top = box.top + (self.pageYOffset || docElem.scrollTop) - clientTop,
            left = box.left + (self.pageXOffset || docElem.scrollLeft) - clientLeft;
            return {
                left: left,
                top: top
            }
        },
        html: function(content) {
            var elem = this[0];
            if (content === undefined) {
                return elem.innerHTML
            }
            $.cleanData(elem.getElementsByTagName("*"));
            elem.innerHTML = content;
            return this
        },
        remove: function() {
            var elem = this[0];
            $.cleanData(elem.getElementsByTagName("*"));
            $.cleanData([elem]);
            elem.parentNode.removeChild(elem);
            return this
        },
        bind: function(type, callback) {
            $.event.add(this[0], type, callback);
            return this
        },
        unbind: function(type, callback) {
            $.event.remove(this[0], type, callback);
            return this
        }
    };
    $.fn.constructor.prototype = $.fn;
    $.isWindow = function(obj) {
        return obj && typeof obj === "object" && "setInterval" in obj
    };
    $.fn.find = function(expr) {
        var value, elem = this[0],
        className = expr.split(".")[1];
        if (className) {
            if (document.getElementsByClassName) {
                value = elem.getElementsByClassName(className)
            } else {
                value = getElementsByClassName(className, elem)
            }
        } else {
            value = elem.getElementsByTagName(expr)
        }
        return $(value[0])
    };
    function getElementsByClassName(className, node, tag) {
        node = node || document;
        tag = tag || "*";
        var i = 0,
        j = 0,
        classElements = [],
        els = node.getElementsByTagName(tag),
        elsLen = els.length,
        pattern = new RegExp("(^|\\s)" + className + "(\\s|$)");
        for (; i < elsLen; i++) {
            if (pattern.test(els[i].className)) {
                classElements[j] = els[i];
                j++
            }
        }
        return classElements
    }
    $.each = function(obj, callback) {
        var name, i = 0,
        length = obj.length,
        isObj = length === undefined;
        if (isObj) {
            for (name in obj) {
                if (callback.call(obj[name], name, obj[name]) === false) {
                    break
                }
            }
        } else {
            for (var value = obj[0]; i < length && callback.call(value, i, value) !== false; value = obj[++i]) {}
        }
        return obj
    };
    $.data = function(elem, name, data) {
        var cache = $.cache,
        id = uuid(elem);
        if (name === undefined) {
            return cache[id]
        }
        if (!cache[id]) {
            cache[id] = {}
        }
        if (data !== undefined) {
            cache[id][name] = data
        }
        return cache[id][name]
    };
    $.removeData = function(elem, name) {
        var empty = true,
        expando = $.expando,
        cache = $.cache,
        id = uuid(elem),
        thisCache = id && cache[id];
        if (!thisCache) {
            return
        }
        if (name) {
            delete thisCache[name];
            for (var n in thisCache) {
                empty = false
            }
            if (empty) {
                delete $.cache[id]
            }
        } else {
            delete cache[id];
            if (elem.removeAttribute) {
                elem.removeAttribute(expando)
            } else {
                elem[expando] = null
            }
        }
    };
    $.uuid = 0;
    $.cache = {};
    $.expando = "@cache" + ( + new Date);
    function uuid(elem) {
        var expando = $.expando,
        id = elem === window ? 0 : elem[expando];
        if (id === undefined) {
            elem[expando] = id = ++$.uuid
        }
        return id
    }
    $.event = {
        add: function(elem, type, callback) {
            var cache, listeners, that = $.event,
            data = $.data(elem, "@events") || $.data(elem, "@events", {});
            cache = data[type] = data[type] || {};
            listeners = cache.listeners = cache.listeners || [];
            listeners.push(callback);
            if (!cache.handler) {
                cache.elem = elem;
                cache.handler = that.handler(cache);
                elem.addEventListener ? elem.addEventListener(type, cache.handler, false) : elem.attachEvent("on" + type, cache.handler)
            }
        },
        remove: function(elem, type, callback) {
            var i, cache, listeners, that = $.event,
            empty = true,
            data = $.data(elem, "@events");
            if (!data) {
                return
            }
            if (!type) {
                for (i in data) {
                    that.remove(elem, i)
                }
                return
            }
            cache = data[type];
            if (!cache) {
                return
            }
            listeners = cache.listeners;
            if (callback) {
                for (i = 0; i < listeners.length; i++) {
                    listeners[i] === callback && listeners.splice(i--, 1)
                }
            } else {
                cache.listeners = []
            }
            if (cache.listeners.length === 0) {
                elem.removeEventListener ? elem.removeEventListener(type, cache.handler, false) : elem.detachEvent("on" + type, cache.handler);
                delete data[type];
                cache = $.data(elem, "@events");
                for (var n in cache) {
                    empty = false
                }
                if (empty) {
                    $.removeData(elem, "@events")
                }
            }
        },
        handler: function(cache) {
            return function(event) {
                event = $.event.fix(event || window.event);
                for (var i = 0,
                list = cache.listeners,
                fn; fn = list[i++];) {
                    if (fn.call(cache.elem, event) === false) {
                        event.preventDefault();
                        event.stopPropagation()
                    }
                }
            }
        },
        fix: function(event) {
            if (event.target) {
                return event
            }
            var eventObj = {
                target: event.srcElement || document,
                preventDefault: function() {
                    event.returnValue = false
                },
                stopPropagation: function() {
                    event.cancelBubble = true
                }
            };
            for (var i in event) {
                eventObj[i] = event[i]
            }
            return eventObj
        }
    };
    $.cleanData = function(elems) {
        var i = 0,
        elem, len = elems.length,
        removeEvent = $.event.remove,
        removeData = $.removeData;
        for (; i < len; i++) {
            elem = elems[i];
            removeEvent(elem);
            removeData(elem)
        }
    };
    $.css = "defaultView" in document && "getComputedStyle" in document.defaultView ?
    function(elem, name) {
        return document.defaultView.getComputedStyle(elem, false)[name]
    }: function(elem, name) {
        return elem.currentStyle[name] || ""
    };
    $.each(["Left", "Top"],
    function(i, name) {
        var method = "scroll" + name;
        $.fn[method] = function() {
            var elem = this[0],
            win;
            win = getWindow(elem);
            return win ? ("pageXOffset" in win) ? win[i ? "pageYOffset": "pageXOffset"] : win.document.documentElement[method] || win.document.body[method] : elem[method]
        }
    });
    function getWindow(elem) {
        return $.isWindow(elem) ? elem: elem.nodeType === 9 ? elem.defaultView || elem.parentWindow: false
    }
    $.each(["Height", "Width"],
    function(i, name) {
        var type = name.toLowerCase();
        $.fn[type] = function(size) {
            var elem = this[0];
            if (!elem) {
                return size == null ? null: this
            }
            return $.isWindow(elem) ? elem.document.documentElement["client" + name] || elem.document.body["client" + name] : (elem.nodeType === 9) ? Math.max(elem.documentElement["client" + name], elem.body["scroll" + name], elem.documentElement["scroll" + name], elem.body["offset" + name], elem.documentElement["offset" + name]) : null
        }
    });
    return $
} (window)); (function($, window, undefined) {
    if (document.compatMode === "BackCompat") {
        throw new Error("artDialog: Document types require more than xhtml1.0")
    }
    var _singleton, _count = 0,
    _activeElement = document.activeElement,
    _root = $(document.getElementsByTagName("html")[0]),
    _expando = "artDialog" + ( + new Date),
    _isIE6 = window.VBArray && !window.XMLHttpRequest,
    _isMobile = "createTouch" in document && !("onmousemove" in document) || /(iPhone|iPad|iPod)/i.test(navigator.userAgent),
    _isFixed = !_isIE6 && !_isMobile;
    var artDialog = function(config, ok, cancel) {
        config = config || {};
        if (typeof config === "string" || config.nodeType === 1) {
            config = {
                content: config,
                fixed: !_isMobile
            }
        }
        var api, defaults = artDialog.defaults;
        var elem = config.follow = this.nodeType === 1 && this || config.follow;
        for (var i in defaults) {
            if (config[i] === undefined) {
                config[i] = defaults[i]
            }
        }
        config.id = elem && elem[_expando + "follow"] || config.id || _expando + _count;
        api = artDialog.list[config.id];
        if (api) {
            if (elem) {
                api.follow(elem)
            }
            api.zIndex().focus();
            return api
        }
        if (!_isFixed) {
            config.fixed = false
        }
        if (!config.button || !config.button.push) {
            config.button = []
        }
        if (ok !== undefined) {
            config.ok = ok
        }
        if (config.ok) {
            config.button.push({
                id: "ok",
                value: config.okValue,
                callback: config.ok,
                focus: true
            })
        }
        if (cancel !== undefined) {
            config.cancel = cancel
        }
        if (config.cancel) {
            config.button.push({
                id: "cancel",
                value: config.cancelValue,
                callback: config.cancel
            })
        }
        artDialog.defaults.zIndex = config.zIndex;
        _count++;
        return artDialog.list[config.id] = _singleton ? _singleton._create(config) : new artDialog.fn._create(config)
    };
    artDialog.version = "5.0.4";
    artDialog.fn = artDialog.prototype = {
        _create: function(config) {
            var dom;
            this.closed = false;
            this.config = config;
            this.dom = dom = this.dom || this._innerHTML(config);
            config.skin && dom.wrap.addClass(config.skin);
            dom.wrap.css("position", config.fixed ? "fixed": "absolute");
            dom.close[config.cancel === false ? "hide": "show"]();
            dom.content.css("padding", config.padding);
            this.button.apply(this, config.button);
            this.title(config.title).content(config.content).size(config.width, config.height).time(config.time);
            this._reset();
            this.zIndex();
            config.lock && this.lock();
            this._addEvent();
            this[config.visible ? "visible": "hidden"]().focus();
            _singleton = null;
            config.initialize && config.initialize.call(this);
            return this
        },
        content: function(message) {
            var prev, next, parent, display, that = this,
            $content = this.dom.content,
            content = $content[0];
            if (this._elemBack) {
                this._elemBack();
                delete this._elemBack
            }
            if (typeof message === "string") {
                $content.html(message)
            } else {
                if (message && message.nodeType === 1) {
                    display = message.style.display;
                    prev = message.previousSibling;
                    next = message.nextSibling;
                    parent = message.parentNode;
                    this._elemBack = function() {
                        if (prev && prev.parentNode) {
                            prev.parentNode.insertBefore(message, prev.nextSibling)
                        } else {
                            if (next && next.parentNode) {
                                next.parentNode.insertBefore(message, next)
                            } else {
                                if (parent) {
                                    parent.appendChild(message)
                                }
                            }
                        }
                        message.style.display = display;
                        that._elemBack = null
                    };
                    $content.html("");
                    content.appendChild(message);
                    $(message).show()
                }
            }
            this._reset();
            return this
        },
        title: function(content) {
            var dom = this.dom,
            outer = dom.outer,
            $title = dom.title,
            className = "d-state-noTitle";
            if (content === false) {
                $title.hide().html("");
                outer.addClass(className)
            } else {
                $title.show().html(content);
                outer.removeClass(className)
            }
            return this
        },
        position: function() {
            var dom = this.dom,
            wrap = dom.wrap[0],
            $window = dom.window,
            $document = dom.document,
            fixed = this.config.fixed,
            dl = fixed ? 0 : $document.scrollLeft(),
            dt = fixed ? 0 : $document.scrollTop(),
            ww = $window.width(),
            wh = $window.height(),
            ow = wrap.offsetWidth,
            oh = wrap.offsetHeight,
            left = (ww - ow) / 2 + dl,
            top = (wh - oh) * 382 / 1000 + dt,
            style = wrap.style;
            style.left = Math.max(parseInt(left), dl) + "px";
            style.top = Math.max(parseInt(top), dt) + "px";
            if (this._follow) {
                this._follow.removeAttribute(_expando + "follow");
                this._follow = null
            }
            return this
        },
        size: function(width, height) {
            var style = this.dom.main[0].style;
            if (typeof width === "number") {
                width = width + "px"
            }
            if (typeof height === "number") {
                height = height + "px"
            }
            style.width = width;
            style.height = height;
            return this
        },
        follow: function(elem) {
            var $elem = $(elem),
            config = this.config;
            if (!elem || !elem.offsetWidth && !elem.offsetHeight) {
                return this.position(this._left, this._top)
            }
            var fixed = config.fixed,
            expando = _expando + "follow",
            dom = this.dom,
            $window = dom.window,
            $document = dom.document,
            winWidth = $window.width(),
            winHeight = $window.height(),
            docLeft = $document.scrollLeft(),
            docTop = $document.scrollTop(),
            offset = $elem.offset(),
            width = elem.offsetWidth,
            height = elem.offsetHeight,
            left = fixed ? offset.left - docLeft: offset.left,
            top = fixed ? offset.top - docTop: offset.top,
            wrap = this.dom.wrap[0],
            style = wrap.style,
            wrapWidth = wrap.offsetWidth,
            wrapHeight = wrap.offsetHeight,
            setLeft = left - (wrapWidth - width) / 2,
            setTop = top + height,
            dl = fixed ? 0 : docLeft,
            dt = fixed ? 0 : docTop;
            setLeft = setLeft < dl ? left: (setLeft + wrapWidth > winWidth) && (left - wrapWidth > dl) ? left - wrapWidth + width: setLeft;
            setTop = (setTop + wrapHeight > winHeight + dt) && (top - wrapHeight > dt) ? top - wrapHeight: setTop;
            style.left = parseInt(setLeft) + "px";
            style.top = parseInt(setTop) + "px";
            this._follow && this._follow.removeAttribute(expando);
            this._follow = elem;
            elem[expando] = config.id;
            return this
        },
        button: function() {
            var dom = this.dom,
            $buttons = dom.buttons,
            elem = $buttons[0],
            strongButton = "d-state-highlight",
            listeners = this._listeners = this._listeners || {},
            ags = [].slice.call(arguments);
            var i = 0,
            val, value, id, isNewButton, button;
            for (; i < ags.length; i++) {
                val = ags[i];
                value = val.value;
                id = val.id || value;
                isNewButton = !listeners[id];
                button = !isNewButton ? listeners[id].elem: document.createElement("input");
                button.type = "button";
                button.className = "d-button";
                if (!listeners[id]) {
                    listeners[id] = {}
                }
                if (value) {
                    button.value = value
                }
                if (val.width) {
                    button.style.width = val.width
                }
                if (val.callback) {
                    listeners[id].callback = val.callback
                }
                if (val.focus) {
                    this._focus && this._focus.removeClass(strongButton);
                    this._focus = $(button).addClass(strongButton);
                    this.focus()
                }
                button[_expando + "callback"] = id;
                button.disabled = !!val.disabled;
                if (isNewButton) {
                    listeners[id].elem = button;
                    elem.appendChild(button)
                }
            }
            $buttons[0].style.display = ags.length ? "": "none";
            return this
        },
        visible: function() {
            this.dom.wrap.css("visibility", "visible");
            this.dom.outer.addClass("d-state-visible");
            if (this._isLock) {
                this._lockMask.show()
            }
            return this
        },
        hidden: function() {
            this.dom.wrap.css("visibility", "hidden");
            this.dom.outer.removeClass("d-state-visible");
            if (this._isLock) {
                this._lockMask.hide()
            }
            return this
        },
        close: function() {
            if (this.closed) {
                return this
            }
            var dom = this.dom,
            $wrap = dom.wrap,
            list = artDialog.list,
            beforeunload = this.config.beforeunload;
            if (beforeunload && beforeunload.call(this) === false) {
                return this
            }
            if (artDialog.focus === this) {
                artDialog.focus = null
            }
            if (this._follow) {
                this._follow.removeAttribute(_expando + "follow")
            }
            if (this._elemBack) {
                this._elemBack()
            }
            this.time();
            this.unlock();
            this._removeEvent();
            delete list[this.config.id];
            if (_singleton) {
                $wrap.remove()
            } else {
                _singleton = this;
                dom.title.html("");
                dom.content.html("");
                dom.buttons.html("");
                $wrap[0].className = $wrap[0].style.cssText = "";
                dom.outer[0].className = "d-outer";
                $wrap.css({
                    left: 0,
                    top: 0,
                    position: _isFixed ? "fixed": "absolute"
                });
                for (var i in this) {
                    if (this.hasOwnProperty(i) && i !== "dom") {
                        delete this[i]
                    }
                }
                this.hidden()
            }
            if (_activeElement) {
                _activeElement.focus()
            }
            this.closed = true;
            return this
        },
        time: function(time) {
            var that = this,
            timer = this._timer;
            timer && clearTimeout(timer);
            if (time) {
                this._timer = setTimeout(function() {
                    that._click("cancel")
                },
                time)
            }
            return this
        },
        focus: function() {
            var that = this,
            isFocus = function() {
                return that.dom.wrap[0].contains(document.activeElement)
            };
            if (!isFocus()) {
                _activeElement = document.activeElement
            }
            setTimeout(function() {
                if (!isFocus()) {
                    try {
                        var elem = that._focus || that.dom.close || taht.dom.wrap;
                        elem[0].focus()
                    } catch(e) {}
                }
            },
            16);
            return this
        },
        zIndex: function() {
            var dom = this.dom,
            top = artDialog.focus,
            index = artDialog.defaults.zIndex++;
            dom.wrap.css("zIndex", index);
            this._lockMask && this._lockMask.css("zIndex", index - 1);
            top && top.dom.outer.removeClass("d-state-focus");
            artDialog.focus = this;
            dom.outer.addClass("d-state-focus");
            return this
        },
        lock: function() {
            if (this._isLock) {
                return this
            }
            var that = this,
            config = this.config,
            dom = this.dom,
            div = document.createElement("div"),
            $div = $(div),
            index = artDialog.defaults.zIndex - 1;
            this.zIndex();
            dom.outer.addClass("d-state-lock");
            $div.css({
                zIndex: index,
                position: "fixed",
                left: 0,
                top: 0,
                width: "100%",
                height: "100%",
                overflow: "hidden"
            }).addClass("d-mask");
            if (!_isFixed) {
                $div.css({
                    position: "absolute",
                    width: $(window).width() + "px",
                    height: $(document).height() + "px"
                })
            }
            $div.bind("dblclick",
            function() {
                that._click("cancel")
            });
            document.body.appendChild(div);
            this._lockMask = $div;
            this._isLock = true;
            return this
        },
        unlock: function() {
            if (!this._isLock) {
                return this
            }
            this._lockMask.unbind();
            this._lockMask.hide();
            this._lockMask.remove();
            this.dom.outer.removeClass("d-state-lock");
            this._isLock = false;
            return this
        },
        _innerHTML: function(data) {
            var body = document.body;
            if (!body) {
                throw new Error('artDialog: "documents.body" not ready')
            }
            var wrap = document.createElement("div");
            wrap.style.cssText = "position:absolute;left:0;top:0";
            wrap.innerHTML = artDialog._templates.replace(/{([^}]+)}/g,
            function($0, $1) {
                var value = data[$1];
                return typeof value === "string" ? value: ""
            });
            body.insertBefore(wrap, body.firstChild);
            var name, i = 0,
            dom = {},
            els = wrap.getElementsByTagName("*"),
            elsLen = els.length;
            for (; i < elsLen; i++) {
                name = els[i].className.split("d-")[1];
                if (name) {
                    dom[name] = $(els[i])
                }
            }
            dom.window = $(window);
            dom.document = $(document);
            dom.wrap = $(wrap);
            return dom
        },
        _click: function(id) {
            var fn = this._listeners[id] && this._listeners[id].callback;
            return typeof fn !== "function" || fn.call(this) !== false ? this.close() : this
        },
        _reset: function() {
            var elem = this.config.follow || this._follow;
            elem ? this.follow(elem) : this.position()
        },
        _addEvent: function() {
            var that = this,
            dom = this.dom;
            dom.wrap.bind("click",
            function(event) {
                var target = event.target,
                callbackID;
                if (target.disabled) {
                    return false
                }
                if (target === dom.close[0]) {
                    that._click("cancel");
                    return false
                } else {
                    callbackID = target[_expando + "callback"];
                    callbackID && that._click(callbackID)
                }
            }).bind("mousedown",
            function() {
                that.zIndex()
            })
        },
        _removeEvent: function() {
            this.dom.wrap.unbind()
        }
    };
    artDialog.fn._create.prototype = artDialog.fn;
    $.fn.dialog = $.fn.artDialog = function() {
        var config = arguments;
        this[this.live ? "live": "bind"]("click",
        function() {
            artDialog.apply(this, config);
            return false
        });
        return this
    };
    artDialog.focus = null;
    artDialog.get = function(id) {
        return id === undefined ? artDialog.list: artDialog.list[id]
    };
    artDialog.list = {};
    $(document).bind("keydown",
    function(event) {
        var target = event.target,
        nodeName = target.nodeName,
        rinput = /^input|textarea$/i,
        api = artDialog.focus,
        keyCode = event.keyCode;
        if (!api || rinput.test(nodeName) && target.type !== "button") {
            return
        }
        keyCode === 27 && api._click("cancel")
    });
    function focusin(event) {
        var api = artDialog.focus;
        if (api && api._isLock && !api.dom.wrap[0].contains(event.target)) {
            event.stopPropagation();
            api.dom.outer[0].focus()
        }
    }
    if ($.fn.live) {
        $("body").live("focus", focusin)
    } else {
        if (document.addEventListener) {
            document.addEventListener("focus", focusin, true)
        } else {
            $(document).bind("focusin", focusin)
        }
    }
    $(window).bind("resize",
    function() {
        var dialogs = artDialog.list;
        for (var id in dialogs) {
            dialogs[id]._reset()
        }
    });
    artDialog._templates = '<div class="d-outer" role="dialog" tabindex="-1" aria-labelledby="d-title-{id}" aria-describedby="d-content-{id}">' + '<table class="d-border">' + "<tbody>" + "<tr>" + '<td class="d-nw"></td>' + '<td class="d-n"></td>' + '<td class="d-ne"></td>' + "</tr>" + "<tr>" + '<td class="d-w"></td>' + '<td class="d-c">' + '<div class="d-inner">' + '<table class="d-dialog">' + "<tbody>" + "<tr>" + '<td class="d-header">' + '<div class="d-titleBar">' + '<div id="d-title-{id}" class="d-title"></div>' + '<a class="d-close" href="javascript:;">×</a>' + "</div>" + "</td>" + "</tr>" + "<tr>" + '<td class="d-main">' + '<div id="d-content-{id}" class="d-content"></div>' + "</td>" + "</tr>" + "<tr>" + '<td class="d-footer">' + '<div class="d-buttons"></div>' + "</td>" + "</tr>" + "</tbody>" + "</table>" + "</div>" + "</td>" + '<td class="d-e"></td>' + "</tr>" + "<tr>" + '<td class="d-sw"></td>' + '<td class="d-s"></td>' + '<td class="d-se"></td>' + "</tr>" + "</tbody>" + "</table>" + "</div>";
    artDialog.defaults = {
        content: '<div class="d-loading"><span>loading..</span></div>',
        title: "message",
        button: null,
        ok: null,
        cancel: null,
        initialize: null,
        beforeunload: null,
        okValue: "ok",
        cancelValue: "cancel",
        width: "auto",
        height: "auto",
        padding: "20px 25px",
        skin: null,
        time: null,
        visible: true,
        follow: null,
        lock: false,
        fixed: false,
        zIndex: 1987
    };
    this.artDialog = $.dialog = $.artDialog = artDialog
} (this.art || this.jQuery, this));
/*!刷新验证码*/
function newgdcode(obj, url) {
    obj.src = url + "&nowtime=" + new Date().getTime()
}
/*!搜索点击*/
function searchon() {
    $("#searchto").click()
}
/*!用户关注*/
function follow(userid, token) {
    $.getJSON(siteUrl + "index.php?app=user&ac=follow&ts=do", {
        "userid": userid,
        "token": token
    },
    function(json) {
        if (json.status == 0) {
            art.dialog({
                content: json.msg,
                time: 1000
            })
        } else {
            if (json.status == 1) {
                art.dialog({
                    content: json.msg,
                    time: 1000
                })
            } else {
                if (json.status == 2) {
                    art.dialog({
                        content: json.msg,
                        time: 1000
                    });
                    window.location.reload()
                }
            }
        }
    })
}
/*!取消用户关注*/
function unfollow(userid, token) {
    $.getJSON(siteUrl + "index.php?app=user&ac=follow&ts=un", {
        "userid": userid,
        "token": token
    },
    function(json) {
        if (json.status == 0) {
            art.dialog({
                content: json.msg,
                time: 1000
            })
        } else {
            if (json.status == 1) {
                art.dialog({
                    content: json.msg,
                    time: 1000
                });
                window.location.reload()
            }
        }
    })
}
/*!显示视频*/
function showVideo(id, url) {
    if ($("#play_" + id).is(":hidden")) {
        $("#swf_" + id).html('<object width="500" height="420" id="swf_' + id + '"><param name="allowscriptaccess" value="always"></param><param name="wmode" value="window"></param><param name="movie" value="' + url + '"></param><embed src="' + url + '" width="500" height="420" allowscriptaccess="always" wmode="window" type="application/x-shockwave-flash"></embed></object>');
        $("#play_" + id).show()
    } else {
        $("#swf_" + id).find("object").remove();
        $("#play_" + id).hide()
    }
    $("#img_" + id).toggle()
}
/*!Jquery input输入框提示插件*/
(function($) {
    $.fn.inputDefault = function(options) {
        var defaults = {
            attrName: "fs",
            size: 0,
            bold: false,
            italic: false,
            color: "#CCC"
        };
        var options = $.extend(defaults, options);
        this.each(function() {
            var $this = $(this);
            var text = $this.attr(options.attrName);
            var offset = $this.position();
            var outerWidth = $this.outerWidth();
            var outerHeight = $this.outerHeight();
            var innerWidth = $this.innerWidth();
            var innerHeight = $this.innerHeight();
            var plusLeft = (outerWidth - innerWidth) / 2;
            var plusTop = (outerHeight - innerHeight) / 2;
            var paddingTop = parseInt($this.css("paddingTop"));
            var paddingRight = parseInt($this.css("paddingRight"));
            var paddingBottom = parseInt($this.css("paddingBottom"));
            var paddingLeft = parseInt($this.css("paddingLeft"));
            if (!$.browser.chrome) {
                var width = innerWidth - (paddingLeft + paddingRight);
                var height = innerHeight - (paddingTop + paddingBottom)
            } else {
                var width = innerWidth - paddingRight;
                var height = innerHeight - paddingBottom
            }
            var top = offset.top + plusTop;
            var left = offset.left + plusLeft;
            var lineHeight = $this.css("lineHeight");
            var display = $this.val() ? "none": "block";
            var fontSize = options.size ? options.size: $this.css("fontSize");
            var fontStyle = options.italic ? "italic": "";
            var fontWeight = options.bold ? "700": $this.css("fontWeight");
            var css = {
                position: "absolute",
                fontSize: fontSize,
                fontWeight: fontWeight,
                fontStyle: fontStyle,
                lineHeight: lineHeight,
                display: display,
                paddingTop: paddingTop,
                paddingRight: paddingRight,
                paddingBottom: paddingBottom,
                paddingLeft: paddingLeft,
                cursor: "text",
                width: width,
                height: height,
                top: top,
                left: left,
                color: options.color,
                overflow: "hidden"
            };
            var lable = $("<label></label>").text(text).css(css).click(function() {
                $(this).hide();
                $(this).prev().focus()
            });
            $this.after(lable)
        }).focus(function() {
            var $this = $(this);
            var $label = $(this).next("label");
            $label.hide()
        }).blur(function() {
            var $this = $(this);
            var $label = $(this).next("label");
            if (!$this.val()) {
                $label.show()
            }
        })
    }
})(jQuery);
$(function() {
    $("[fs]").inputDefault()
});
/*!validform*/
(function($, win, undef) {
    var errorobj = null,
    msgobj = null,
    msghidden = true;
    var tipmsg = {
        tit: "提示信息",
        w: {
            "*": "不能为空！",
            "*6-16": "请填写6到16位任意字符！",
            "n": "请填写数字！",
            "n6-16": "请填写6到16位数字！",
            "s": "不能输入特殊字符！",
            "s6-18": "请填写6到18位字符！",
            "p": "请填写邮政编码！",
            "m": "请填写手机号码！",
            "e": "邮箱地址格式不对！",
            "url": "请填写网址！"
        },
        def: "请填写正确信息！",
        undef: "datatype未定义！",
        reck: "两次输入的内容不一致！",
        r: "通过信息验证！",
        c: "正在检测信息…",
        s: "请填入信息！",
        s_auto: "请{填写}{0}！",
        v: "所填信息没有经过验证，请稍后…",
        p: "正在提交数据…"
    };
    $.Tipmsg = tipmsg;
    var Validform = function(forms, settings, inited) {
        var settings = $.extend({},
        Validform.defaults, settings);
        settings.datatype && $.extend(Validform.util.dataType, settings.datatype);
        var brothers = this;
        brothers.tipmsg = {
            w: {}
        };
        brothers.settings = settings;
        brothers.forms = forms;
        brothers.objects = [];
        if (inited === true) {
            return false
        }
        forms.each(function() {
            if (this.validform_inited == "inited") {
                return true
            }
            this.validform_inited = "inited";
            var $this = $(this);
            this.validform_status = "normal";
            $this.data("tipmsg", brothers.tipmsg);
            $this.find("[datatype]").live("blur",
            function() {
                var subpost = arguments[1];
                Validform.util.check.call(this, $this, brothers, subpost)
            });
            Validform.util.enhance.call($this, settings.tiptype, settings.usePlugin, settings.tipSweep);
            settings.btnSubmit && $this.find(settings.btnSubmit).bind("click",
            function() {
                $this.trigger("submit");
                return false
            });
            $this.submit(function() {
                var subflag = Validform.util.submitForm.call($this, settings);
                subflag === undef && (subflag = true);
                return subflag
            });
            $this.find("[type='reset']").add($this.find(settings.btnReset)).bind("click",
            function() {
                Validform.util.resetForm.call($this)
            })
        });
        if (settings.tiptype == 1 || (settings.tiptype == 2 || settings.tiptype == 3) && settings.ajaxPost) {
            creatMsgbox()
        }
    };
    Validform.defaults = {
        tiptype: 1,
        tipSweep: false,
        showAllError: false,
        postonce: false,
        ajaxPost: false
    };
    Validform.util = {
        dataType: {
            "*": /[\w\W]+/,
            "*6-16": /^[\w\W]{6,16}$/,
            "n": /^\d+$/,
            "n6-16": /^\d{6,16}$/,
            "s": /^[\u4E00-\u9FA5\uf900-\ufa2d\w\.\s]+$/,
            "s6-18": /^[\u4E00-\u9FA5\uf900-\ufa2d\w\.\s]{6,18}$/,
            "p": /^[0-9]{6}$/,
            "m": /^13[0-9]{9}$|14[0-9]{9}|15[0-9]{9}$|18[0-9]{9}$/,
            "e": /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
            "url": /^(\w+:\/\/)?\w+(\.\w+)+.*$/
        },
        toString: Object.prototype.toString,
        getValue: function(obj) {
            var inputval, curform = this;
            if (obj.is(":radio")) {
                inputval = curform.find(":radio[name='" + obj.attr("name") + "']:checked").val();
                inputval = inputval === undef ? "": inputval
            } else {
                if (obj.is(":checkbox")) {
                    inputval = "";
                    curform.find(":checkbox[name='" + obj.attr("name") + "']:checked").each(function() {
                        inputval += $(this).val() + ","
                    });
                    inputval = inputval === undef ? "": inputval
                } else {
                    inputval = obj.val()
                }
            }
            return $.trim(inputval)
        },
        isEmpty: function(val) {
            return val === "" || val === $.trim(this.attr("tip"))
        },
        enhance: function(tiptype, usePlugin, tipSweep, addRule) {
            var curform = this;
            curform.find("[datatype]").each(function() {
                if (tiptype == 2) {
                    if ($(this).parent().next().find(".Validform_checktip").length == 0) {
                        $(this).parent().next().append("<span class='Validform_checktip' />")
                    }
                } else {
                    if (tiptype == 3 || tiptype == 4) {
                        if ($(this).siblings(".Validform_checktip").length == 0) {
                            $(this).parent().append("<span class='Validform_checktip' />")
                        }
                    }
                }
            });
            curform.find("input[recheck]").each(function() {
                if (this.validform_inited == "inited") {
                    return true
                }
                this.validform_inited = "inited";
                var _this = $(this);
                var recheckinput = curform.find("input[name='" + $(this).attr("recheck") + "']");
                recheckinput.bind("keyup",
                function() {
                    if (recheckinput.val() == _this.val() && recheckinput.val() != "") {
                        if (recheckinput.attr("tip")) {
                            if (recheckinput.attr("tip") == recheckinput.val()) {
                                return false
                            }
                        }
                        _this.trigger("blur")
                    }
                }).bind("blur",
                function() {
                    if (recheckinput.val() != _this.val() && _this.val() != "") {
                        if (_this.attr("tip")) {
                            if (_this.attr("tip") == _this.val()) {
                                return false
                            }
                        }
                        _this.trigger("blur")
                    }
                })
            });
            curform.find("[tip]").each(function() {
                if (this.validform_inited == "inited") {
                    return true
                }
                this.validform_inited = "inited";
                var defaultvalue = $(this).attr("tip");
                var altercss = $(this).attr("altercss");
                $(this).focus(function() {
                    if ($(this).val() == defaultvalue) {
                        $(this).val("");
                        if (altercss) {
                            $(this).removeClass(altercss)
                        }
                    }
                }).blur(function() {
                    if ($.trim($(this).val()) === "") {
                        $(this).val(defaultvalue);
                        if (altercss) {
                            $(this).addClass(altercss)
                        }
                    }
                })
            });
            curform.find(":checkbox[datatype],:radio[datatype]").each(function() {
                if (this.validform_inited == "inited") {
                    return true
                }
                this.validform_inited = "inited";
                var _this = $(this);
                var name = _this.attr("name");
                curform.find("[name='" + name + "']").filter(":checkbox,:radio").bind("click",
                function() {
                    setTimeout(function() {
                        _this.trigger("blur")
                    },
                    0)
                })
            });
            curform.find("select[datatype][multiple]").bind("click",
            function() {
                var _this = $(this);
                setTimeout(function() {
                    _this.trigger("blur")
                },
                0)
            });
            Validform.util.usePlugin.call(curform, usePlugin, tiptype, tipSweep, addRule)
        },
        usePlugin: function(plugin, tiptype, tipSweep, addRule) {
            var curform = this,
            plugin = plugin || {};
            if (curform.find("input[plugin='swfupload']").length && typeof(swfuploadhandler) != "undefined") {
                var custom = {
                    custom_settings: {
                        form: curform,
                        showmsg: function(msg, type, obj) {
                            Validform.util.showmsg.call(curform, msg, tiptype, {
                                obj: curform.find("input[plugin='swfupload']"),
                                type: type,
                                sweep: tipSweep
                            })
                        }
                    }
                };
                custom = $.extend(true, {},
                plugin.swfupload, custom);
                curform.find("input[plugin='swfupload']").each(function(n) {
                    if (this.validform_inited == "inited") {
                        return true
                    }
                    this.validform_inited = "inited";
                    $(this).val("");
                    swfuploadhandler.init(custom, n)
                })
            }
            if (curform.find("input[plugin='datepicker']").length && $.fn.datePicker) {
                plugin.datepicker = plugin.datepicker || {};
                if (plugin.datepicker.format) {
                    Date.format = plugin.datepicker.format;
                    delete plugin.datepicker.format
                }
                if (plugin.datepicker.firstDayOfWeek) {
                    Date.firstDayOfWeek = plugin.datepicker.firstDayOfWeek;
                    delete plugin.datepicker.firstDayOfWeek
                }
                curform.find("input[plugin='datepicker']").each(function(n) {
                    if (this.validform_inited == "inited") {
                        return true
                    }
                    this.validform_inited = "inited";
                    plugin.datepicker.callback && $(this).bind("dateSelected",
                    function() {
                        var d = new Date($.event._dpCache[this._dpId].getSelected()[0]).asString(Date.format);
                        plugin.datepicker.callback(d, this)
                    });
                    $(this).datePicker(plugin.datepicker)
                })
            }
            if (curform.find("input[plugin*='passwordStrength']").length && $.fn.passwordStrength) {
                plugin.passwordstrength = plugin.passwordstrength || {};
                plugin.passwordstrength.showmsg = function(obj, msg, type) {
                    Validform.util.showmsg.call(curform, msg, tiptype, {
                        obj: obj,
                        type: type,
                        sweep: tipSweep
                    })
                };
                curform.find("input[plugin='passwordStrength']").each(function(n) {
                    if (this.validform_inited == "inited") {
                        return true
                    }
                    this.validform_inited = "inited";
                    $(this).passwordStrength(plugin.passwordstrength)
                })
            }
            if (addRule != "addRule" && plugin.jqtransform && $.fn.jqTransSelect) {
                var jqTransformHideSelect = function(oTarget) {
                    var ulVisible = $(".jqTransformSelectWrapper ul:visible");
                    ulVisible.each(function() {
                        var oSelect = $(this).parents(".jqTransformSelectWrapper:first").find("select").get(0);
                        if (! (oTarget && oSelect.oLabel && oSelect.oLabel.get(0) == oTarget.get(0))) {
                            $(this).hide()
                        }
                    })
                };
                var jqTransformCheckExternalClick = function(event) {
                    if ($(event.target).parents(".jqTransformSelectWrapper").length === 0) {
                        jqTransformHideSelect($(event.target))
                    }
                };
                var jqTransformAddDocumentListener = function() {
                    $(document).mousedown(jqTransformCheckExternalClick)
                };
                if (plugin.jqtransform.selector) {
                    curform.find(plugin.jqtransform.selector).filter('input:submit, input:reset, input[type="button"]').jqTransInputButton();
                    curform.find(plugin.jqtransform.selector).filter("input:text, input:password").jqTransInputText();
                    curform.find(plugin.jqtransform.selector).filter("input:checkbox").jqTransCheckBox();
                    curform.find(plugin.jqtransform.selector).filter("input:radio").jqTransRadio();
                    curform.find(plugin.jqtransform.selector).filter("textarea").jqTransTextarea();
                    if (curform.find(plugin.jqtransform.selector).filter("select").length > 0) {
                        curform.find(plugin.jqtransform.selector).filter("select").jqTransSelect();
                        jqTransformAddDocumentListener()
                    }
                } else {
                    curform.jqTransform()
                }
                curform.find(".jqTransformSelectWrapper").find("li a").click(function() {
                    $(this).parents(".jqTransformSelectWrapper").find("select").trigger("blur")
                })
            }
        },
        getNullmsg: function(curform) {
            var obj = this;
            var reg = /[\u4E00-\u9FA5\uf900-\ufa2da-zA-Z\s]+/g;
            var nullmsg;
            var label = obj.siblings(".Validform_label").text() || obj.siblings().find(".Validform_label").text() || obj.parent().siblings(".Validform_label").text() || obj.parent().siblings().find(".Validform_label").text();
            label = label.match(reg);
            if (label) {
                label = label[0].replace(/\s(?![a-zA-Z])/g, "");
                nullmsg = tipmsg.s_auto.replace(/\{0\}/, label);
                if (obj.attr("recheck")) {
                    nullmsg = nullmsg.replace(/\{(.+)\}/, "")
                } else {
                    nullmsg = nullmsg.replace(/\{(.+)\}/, "$1")
                }
            } else {
                nullmsg = curform.data("tipmsg").s || tipmsg.s
            }
            obj.attr("nullmsg", nullmsg);
            return nullmsg
        },
        getErrormsg: function(curform, datatype, recheck) {
            var obj = this;
            var regxp = /^(.+?)((\d+)-(\d+))?$/,
            regxp2 = /^(.+?)(\d+)-(\d+)$/,
            regxp3 = /(.*?)\d+(.+?)\d+(.*)/,
            mac = datatype.match(regxp),
            temp,
            str;
            if (recheck == "recheck") {
                str = curform.data("tipmsg").reck || tipmsg.reck;
                return str
            }
            if (mac[0] in tipmsg.w) {
                return curform.data("tipmsg").w[mac[0]] || tipmsg.w[mac[0]]
            }
            for (var name in tipmsg.w) {
                if (name.indexOf(mac[1]) != -1 && regxp2.test(name)) {
                    str = (curform.data("tipmsg").w[name] || tipmsg.w[name]).replace(regxp3, "$1" + mac[3] + "$2" + mac[4] + "$3");
                    tipmsg.w[mac[0]] = str;
                    return str
                }
            }
            return curform.data("tipmsg").def || tipmsg.def
        },
        _regcheck: function(datatype, gets, obj, curform) {
            var curform = curform,
            info = null,
            passed = false,
            reg = /\/.+\//g,
            regex = /^(.+?)(\d+)-(\d+)$/,
            type = 3;
            if (reg.test(datatype)) {
                var regstr = datatype.match(reg)[0].slice(1, -1);
                var param = datatype.replace(reg, "");
                var rexp = RegExp(regstr, param);
                passed = rexp.test(gets)
            } else {
                if (Validform.util.toString.call(Validform.util.dataType[datatype]) == "[object Function]") {
                    passed = Validform.util.dataType[datatype](gets, obj, curform, Validform.util.dataType);
                    if (passed === true || passed === undef) {
                        passed = true
                    } else {
                        info = passed;
                        passed = false
                    }
                } else {
                    if (! (datatype in Validform.util.dataType)) {
                        var mac = datatype.match(regex),
                        temp;
                        if (!mac) {
                            passed = false;
                            info = curform.data("tipmsg").undef || tipmsg.undef
                        } else {
                            for (var name in Validform.util.dataType) {
                                temp = name.match(regex);
                                if (!temp) {
                                    continue
                                }
                                if (mac[1] === temp[1]) {
                                    var str = Validform.util.dataType[name].toString(),
                                    param = str.match(/\/[mgi]*/g)[1].replace("/", ""),
                                    regxp = new RegExp("\\{" + temp[2] + "," + temp[3] + "\\}", "g");
                                    str = str.replace(/\/[mgi]*/g, "/").replace(regxp, "{" + mac[2] + "," + mac[3] + "}").replace(/^\//, "").replace(/\/$/, "");
                                    Validform.util.dataType[datatype] = new RegExp(str, param);
                                    break
                                }
                            }
                        }
                    }
                    if (Validform.util.toString.call(Validform.util.dataType[datatype]) == "[object RegExp]") {
                        passed = Validform.util.dataType[datatype].test(gets)
                    }
                }
            }
            if (passed) {
                type = 2;
                info = obj.attr("sucmsg") || curform.data("tipmsg").r || tipmsg.r;
                if (obj.attr("recheck")) {
                    var theother = curform.find("input[name='" + obj.attr("recheck") + "']:first");
                    if (gets != theother.val()) {
                        passed = false;
                        type = 3;
                        info = obj.attr("errormsg") || Validform.util.getErrormsg.call(obj, curform, datatype, "recheck")
                    }
                }
            } else {
                info = info || obj.attr("errormsg") || Validform.util.getErrormsg.call(obj, curform, datatype);
                if (Validform.util.isEmpty.call(obj, gets)) {
                    info = obj.attr("nullmsg") || Validform.util.getNullmsg.call(obj, curform)
                }
            }
            return {
                passed: passed,
                type: type,
                info: info
            }
        },
        regcheck: function(datatype, gets, obj) {
            var curform = this,
            info = null,
            passed = false,
            type = 3;
            if (obj.attr("ignore") === "ignore" && Validform.util.isEmpty.call(obj, gets)) {
                if (obj.data("cked")) {
                    info = ""
                }
                return {
                    passed: true,
                    type: 4,
                    info: info
                }
            }
            obj.data("cked", "cked");
            var dtype = Validform.util.parseDatatype(datatype);
            var res;
            for (var eithor = 0; eithor < dtype.length; eithor++) {
                for (var dtp = 0; dtp < dtype[eithor].length; dtp++) {
                    res = Validform.util._regcheck(dtype[eithor][dtp], gets, obj, curform);
                    if (!res.passed) {
                        break
                    }
                }
                if (res.passed) {
                    break
                }
            }
            return res
        },
        parseDatatype: function(datatype) {
            var reg = /\/.+?\/[mgi]*(?=(,|$|\||\s))|[\w\*-]+/g,
            dtype = datatype.match(reg),
            sepor = datatype.replace(reg, "").replace(/\s*/g, "").split(""),
            arr = [],
            m = 0;
            arr[0] = [];
            arr[0].push(dtype[0]);
            for (var n = 0; n < sepor.length; n++) {
                if (sepor[n] == "|") {
                    m++;
                    arr[m] = []
                }
                arr[m].push(dtype[n + 1])
            }
            return arr
        },
        showmsg: function(msg, type, o, triggered) {
            if (msg == undef) {
                return
            }
            if (triggered == "bycheck" && o.sweep && o.obj && !o.obj.is(".Validform_error")) {
                return
            }
            $.extend(o, {
                curform: this
            });
            if (typeof type == "function") {
                type(msg, o, Validform.util.cssctl);
                return
            }
            if (type == 1 || triggered == "byajax" && type != 4) {
                msgobj.find(".Validform_info").html(msg)
            }
            if (type == 1 && triggered != "bycheck" && o.type != 2 || triggered == "byajax" && type != 4) {
                msghidden = false;
                msgobj.find(".iframe").css("height", msgobj.outerHeight());
                msgobj.show();
                setCenter(msgobj, 100)
            }
            if (type == 2 && o.obj) {
                o.obj.parent().next().find(".Validform_checktip").html(msg);
                Validform.util.cssctl(o.obj.parent().next().find(".Validform_checktip"), o.type)
            }
            if ((type == 3 || type == 4) && o.obj) {
                o.obj.siblings(".Validform_checktip").html(msg);
                Validform.util.cssctl(o.obj.siblings(".Validform_checktip"), o.type)
            }
        },
        cssctl: function(obj, status) {
            switch (status) {
            case 1:
                obj.removeClass("Validform_right Validform_wrong").addClass("Validform_checktip Validform_loading");
                break;
            case 2:
                obj.removeClass("Validform_wrong Validform_loading").addClass("Validform_checktip Validform_right");
                break;
            case 4:
                obj.removeClass("Validform_right Validform_wrong Validform_loading").addClass("Validform_checktip");
                break;
            default:
                obj.removeClass("Validform_right Validform_loading").addClass("Validform_checktip Validform_wrong")
            }
        },
        getQuery: function(url, get) {
            var queryindex = url.indexOf("?");
            if (queryindex != -1 && !get) {
                return {
                    query: url.substring(queryindex + 1) + "&",
                    url: url.substring(0, queryindex)
                }
            } else {
                return {
                    query: "",
                    url: url
                }
            }
        },
        check: function(curform, brothers, subpost, bool) {
            var settings = brothers.settings;
            var subpost = subpost || "";
            var inputval = Validform.util.getValue.call(curform, $(this));
            if (settings.ignoreHidden && $(this).is(":hidden") || $(this).data("dataIgnore") === "dataIgnore") {
                return true
            }
            if (settings.dragonfly && !$(this).data("cked") && Validform.util.isEmpty.call($(this), inputval) && $(this).attr("ignore") != "ignore") {
                return false
            }
            var flag = Validform.util.regcheck.call(curform, $(this).attr("datatype"), inputval, $(this));
            if (inputval == this.validform_lastval && !$(this).attr("recheck") && subpost == "") {
                return flag.passed ? true: false
            }
            this.validform_lastval = inputval;
            var _this;
            errorobj = _this = $(this);
            if (!flag.passed) {
                Validform.util.abort.call(_this[0]);
                if (!bool) {
                    Validform.util.showmsg.call(curform, flag.info, settings.tiptype, {
                        obj: $(this),
                        type: flag.type,
                        sweep: settings.tipSweep
                    },
                    "bycheck"); ! settings.tipSweep && _this.addClass("Validform_error")
                }
                return false
            }
            if ($(this).attr("ajaxurl") && !Validform.util.isEmpty.call($(this), inputval) && !bool) {
                var inputobj = $(this);
                if (subpost == "postform") {
                    inputobj[0].validform_subpost = "postform"
                } else {
                    inputobj[0].validform_subpost = ""
                }
                if (inputobj[0].validform_valid === "posting" && inputval == inputobj[0].validform_ckvalue) {
                    return "ajax"
                }
                inputobj[0].validform_valid = "posting";
                inputobj[0].validform_ckvalue = inputval;
                Validform.util.showmsg.call(curform, brothers.tipmsg.c || tipmsg.c, settings.tiptype, {
                    obj: inputobj,
                    type: 1,
                    sweep: settings.tipSweep
                },
                "bycheck");
                Validform.util.abort.call(_this[0]);
                var ajaxsetup = curform[0].validform_config || {};
                ajaxsetup = ajaxsetup.ajaxurl || {};
                var ajaxurl = Validform.util.getQuery.call(win, inputobj.attr("ajaxurl"), /get/i.test(ajaxsetup.type));
                var localconfig = {
                    type: "get",
                    cache: false,
                    url: ajaxurl.url,
                    data: ajaxurl.query + "param=" + encodeURIComponent(inputval) + "&name=" + encodeURIComponent($(this).attr("name")),
                    success: function(data) {
                        if (data.status === "y") {
                            inputobj[0].validform_valid = "true";
                            data.info && inputobj.attr("sucmsg", data.info);
                            Validform.util.showmsg.call(curform, inputobj.attr("sucmsg") || brothers.tipmsg.r || tipmsg.r, settings.tiptype, {
                                obj: inputobj,
                                type: 2,
                                sweep: settings.tipSweep
                            },
                            "bycheck");
                            _this.removeClass("Validform_error");
                            errorobj = null;
                            if (inputobj[0].validform_subpost == "postform") {
                                curform.trigger("submit")
                            }
                        } else {
                            inputobj[0].validform_valid = data.info;
                            Validform.util.showmsg.call(curform, data.info, settings.tiptype, {
                                obj: inputobj,
                                type: 3,
                                sweep: settings.tipSweep
                            });
                            _this.addClass("Validform_error")
                        }
                        _this[0].validform_ajax = null
                    },
                    error: function(data) {
                        if (data.responseText == "y") {
                            ajaxsetup.success({
                                "status": "y"
                            });
                            return false
                        }
                        if (data.statusText !== "abort") {
                            var msg = "status: " + data.status + "; statusText: " + data.statusText;
                            Validform.util.showmsg.call(curform, msg, settings.tiptype, {
                                obj: inputobj,
                                type: 3,
                                sweep: settings.tipSweep
                            });
                            _this.addClass("Validform_error")
                        }
                        inputobj[0].validform_valid = data.statusText;
                        _this[0].validform_ajax = null;
                        return true
                    }
                };
                if (ajaxsetup.success) {
                    var temp_suc = ajaxsetup.success;
                    ajaxsetup.success = function(data) {
                        localconfig.success(data);
                        temp_suc(data, inputobj)
                    }
                }
                if (ajaxsetup.error) {
                    var temp_err = ajaxsetup.error;
                    ajaxsetup.error = function(data) {
                        localconfig.error(data) && temp_err(data, inputobj)
                    }
                }
                ajaxsetup = $.extend({},
                localconfig, ajaxsetup, {
                    dataType: "json"
                });
                _this[0].validform_ajax = $.ajax(ajaxsetup);
                return "ajax"
            } else {
                if ($(this).attr("ajaxurl") && Validform.util.isEmpty.call($(this), inputval)) {
                    Validform.util.abort.call(_this[0]);
                    _this[0].validform_valid = "true"
                }
            }
            if (!bool) {
                Validform.util.showmsg.call(curform, flag.info, settings.tiptype, {
                    obj: $(this),
                    type: flag.type,
                    sweep: settings.tipSweep
                },
                "bycheck");
                _this.removeClass("Validform_error")
            }
            errorobj = null;
            return true
        },
        submitForm: function(settings, flg, url, ajaxPost, sync) {
            var curform = this;
            if (curform[0].validform_status === "posting") {
                return false
            }
            if (settings.postonce && curform[0].validform_status === "posted") {
                return false
            }
            var beforeCheck = settings.beforeCheck && settings.beforeCheck(curform);
            if (beforeCheck === false) {
                return false
            }
            var flag = true,
            inflag;
            curform.find("[datatype]").each(function() {
                if (flg) {
                    return false
                }
                if (settings.ignoreHidden && $(this).is(":hidden") || $(this).data("dataIgnore") === "dataIgnore") {
                    return true
                }
                var inputval = Validform.util.getValue.call(curform, $(this)),
                _this;
                errorobj = _this = $(this);
                inflag = Validform.util.regcheck.call(curform, $(this).attr("datatype"), inputval, $(this));
                if (!inflag.passed) {
                    Validform.util.showmsg.call(curform, inflag.info, settings.tiptype, {
                        obj: $(this),
                        type: inflag.type,
                        sweep: settings.tipSweep
                    });
                    _this.addClass("Validform_error");
                    if (!settings.showAllError) {
                        _this.focus();
                        flag = false;
                        return false
                    }
                    flag && (flag = false);
                    return true
                }
                if ($(this).attr("ajaxurl") && !Validform.util.isEmpty.call($(this), inputval)) {
                    if (this.validform_valid !== "true") {
                        var thisobj = $(this);
                        Validform.util.showmsg.call(curform, curform.data("tipmsg").v || tipmsg.v, settings.tiptype, {
                            obj: thisobj,
                            type: 3,
                            sweep: settings.tipSweep
                        });
                        _this.addClass("Validform_error");
                        setTimeout(function() {
                            thisobj.trigger("blur", ["postform"])
                        },
                        1500);
                        if (!settings.showAllError) {
                            flag = false;
                            return false
                        }
                        flag && (flag = false);
                        return true
                    }
                } else {
                    if ($(this).attr("ajaxurl") && Validform.util.isEmpty.call($(this), inputval)) {
                        Validform.util.abort.call(this);
                        this.validform_valid = "true"
                    }
                }
                Validform.util.showmsg.call(curform, inflag.info, settings.tiptype, {
                    obj: $(this),
                    type: inflag.type,
                    sweep: settings.tipSweep
                });
                _this.removeClass("Validform_error");
                errorobj = null
            });
            if (settings.showAllError) {
                curform.find(".Validform_error:first").focus()
            }
            if (flag) {
                var beforeSubmit = settings.beforeSubmit && settings.beforeSubmit(curform);
                if (beforeSubmit === false) {
                    return false
                }
                curform[0].validform_status = "posting";
                var config = curform[0].validform_config || {};
                if (settings.ajaxPost || ajaxPost === "ajaxPost") {
                    var ajaxsetup = config.ajaxpost || {};
                    ajaxsetup.url = url || ajaxsetup.url || config.url || curform.attr("action");
                    ajaxsetup.success || ajaxsetup.error || Validform.util.showmsg.call(curform, curform.data("tipmsg").p || tipmsg.p, settings.tiptype, {
                        obj: curform,
                        type: 1,
                        sweep: settings.tipSweep
                    },
                    "byajax");
                    if (sync) {
                        ajaxsetup.async = false
                    } else {
                        if (sync === false) {
                            ajaxsetup.async = true
                        }
                    }
                    if (ajaxsetup.success) {
                        var temp_suc = ajaxsetup.success;
                        ajaxsetup.success = function(data) {
                            settings.callback && settings.callback(data);
                            curform[0].validform_ajax = null;
                            if (data.status === "y") {
                                curform[0].validform_status = "posted"
                            } else {
                                curform[0].validform_status = "normal"
                            }
                            temp_suc(data, curform)
                        }
                    }
                    if (ajaxsetup.error) {
                        var temp_err = ajaxsetup.error;
                        ajaxsetup.error = function(data) {
                            settings.callback && settings.callback(data);
                            curform[0].validform_status = "normal";
                            curform[0].validform_ajax = null;
                            temp_err(data, curform)
                        }
                    }
                    var localconfig = {
                        type: "POST",
                        async: true,
                        data: curform.serializeArray(),
                        success: function(data) {
                            if (data.status === "y") {
                                curform[0].validform_status = "posted";
                                Validform.util.showmsg.call(curform, data.info, settings.tiptype, {
                                    obj: curform,
                                    type: 2,
                                    sweep: settings.tipSweep
                                },
                                "byajax")
                            } else {
                                curform[0].validform_status = "normal";
                                Validform.util.showmsg.call(curform, data.info, settings.tiptype, {
                                    obj: curform,
                                    type: 3,
                                    sweep: settings.tipSweep
                                },
                                "byajax")
                            }
                            settings.callback && settings.callback(data);
                            curform[0].validform_ajax = null
                        },
                        error: function(data) {
                            var msg = "status: " + data.status + "; statusText: " + data.statusText;
                            Validform.util.showmsg.call(curform, msg, settings.tiptype, {
                                obj: curform,
                                type: 3,
                                sweep: settings.tipSweep
                            },
                            "byajax");
                            settings.callback && settings.callback(data);
                            curform[0].validform_status = "normal";
                            curform[0].validform_ajax = null
                        }
                    };
                    ajaxsetup = $.extend({},
                    localconfig, ajaxsetup, {
                        dataType: "json"
                    });
                    curform[0].validform_ajax = $.ajax(ajaxsetup)
                } else {
                    if (!settings.postonce) {
                        curform[0].validform_status = "normal"
                    }
                    var url = url || config.url;
                    if (url) {
                        curform.attr("action", url)
                    }
                    return settings.callback && settings.callback(curform)
                }
            }
            return false
        },
        resetForm: function() {
            var brothers = this;
            brothers.each(function() {
                this.reset();
                this.validform_status = "normal"
            });
            brothers.find(".Validform_right").text("");
            brothers.find(".passwordStrength").children().removeClass("bgStrength");
            brothers.find(".Validform_checktip").removeClass("Validform_wrong Validform_right Validform_loading");
            brothers.find(".Validform_error").removeClass("Validform_error");
            brothers.find("[datatype]").removeData("cked").removeData("dataIgnore");
            brothers.eq(0).find("input:first").focus()
        },
        abort: function() {
            if (this.validform_ajax) {
                this.validform_ajax.abort()
            }
        }
    };
    $.Datatype = Validform.util.dataType;
    Validform.prototype = {
        dataType: Validform.util.dataType,
        eq: function(n) {
            var obj = this;
            if (n >= obj.forms.length) {
                return null
            }
            if (! (n in obj.objects)) {
                obj.objects[n] = new Validform($(obj.forms[n]).get(), obj.settings, true)
            }
            return obj.objects[n]
        },
        resetStatus: function() {
            var obj = this;
            $(obj.forms).each(function() {
                this.validform_status = "normal"
            });
            return this
        },
        setStatus: function(status) {
            var obj = this;
            $(obj.forms).each(function() {
                this.validform_status = status || "posting"
            });
            return this
        },
        getStatus: function() {
            var obj = this;
            var status = $(obj.forms)[0].validform_status;
            return status
        },
        ignore: function(selector) {
            var obj = this;
            var selector = selector || "[datatype]";
            $(obj.forms).find(selector).each(function() {
                $(this).data("dataIgnore", "dataIgnore").removeClass("Validform_error")
            });
            return this
        },
        unignore: function(selector) {
            var obj = this;
            var selector = selector || "[datatype]";
            $(obj.forms).find(selector).each(function() {
                $(this).removeData("dataIgnore")
            });
            return this
        },
        addRule: function(rule) {
            var obj = this;
            var rule = rule || [];
            for (var index = 0; index < rule.length; index++) {
                var o = $(obj.forms).find(rule[index].ele);
                for (var attr in rule[index]) {
                    attr !== "ele" && o.attr(attr, rule[index][attr])
                }
            }
            $(obj.forms).each(function() {
                var $this = $(this);
                Validform.util.enhance.call($this, obj.settings.tiptype, obj.settings.usePlugin, obj.settings.tipSweep, "addRule")
            });
            return this
        },
        ajaxPost: function(flag, sync, url) {
            var obj = this;
            if (obj.settings.tiptype == 1 || obj.settings.tiptype == 2 || obj.settings.tiptype == 3) {
                creatMsgbox()
            }
            Validform.util.submitForm.call($(obj.forms[0]), obj.settings, flag, url, "ajaxPost", sync);
            return this
        },
        submitForm: function(flag, url) {
            var obj = this;
            var subflag = Validform.util.submitForm.call($(obj.forms[0]), obj.settings, flag, url);
            subflag === undef && (subflag = true);
            if (subflag === true) {
                obj.forms[0].submit()
            }
            return this
        },
        resetForm: function() {
            var obj = this;
            Validform.util.resetForm.call($(obj.forms));
            return this
        },
        abort: function() {
            var obj = this;
            $(obj.forms).each(function() {
                Validform.util.abort.call(this)
            });
            return this
        },
        check: function(bool, selector) {
            var selector = selector || "[datatype]",
            obj = this,
            curform = $(obj.forms),
            flag = true;
            curform.find(selector).each(function() {
                Validform.util.check.call(this, curform, obj, "", bool) || (flag = false)
            });
            return flag
        },
        config: function(setup) {
            var obj = this;
            setup = setup || {};
            $(obj.forms).each(function() {
                this.validform_config = $.extend(true, this.validform_config, setup)
            });
            return this
        }
    };
    $.fn.Validform = function(settings) {
        return new Validform(this, settings)
    };
    function setCenter(obj, time) {
        var left = ($(window).width() - obj.outerWidth()) / 2,
        top = ($(window).height() - obj.outerHeight()) / 2,
        top = (document.documentElement.scrollTop ? document.documentElement.scrollTop: document.body.scrollTop) + (top > 0 ? top: 0);
        obj.css({
            left: left
        }).animate({
            top: top
        },
        {
            duration: time,
            queue: false
        })
    }
    function creatMsgbox() {
        if ($("#Validform_msg").length !== 0) {
            return false
        }
        msgobj = $('<div id="Validform_msg"><div class="Validform_title">' + tipmsg.tit + '<a class="Validform_close" href="javascript:void(0);">&chi;</a></div><div class="Validform_info"></div><div class="iframe"><iframe frameborder="0" scrolling="no" height="100%" width="100%"></iframe></div></div>').appendTo("body");
        msgobj.find("a.Validform_close").click(function() {
            msgobj.hide();
            msghidden = true;
            if (errorobj) {
                errorobj.focus().addClass("Validform_error")
            }
            return false
        }).focus(function() {
            this.blur()
        });
        $(window).bind("scroll resize",
        function() { ! msghidden && setCenter(msgobj, 400)
        })
    }
    $.Showmsg = function(msg) {
        creatMsgbox();
        Validform.util.showmsg.call(win, msg, 1, {})
    };
    $.Hidemsg = function() {
        msgobj.hide();
        msghidden = true
    }
})(jQuery, window);